/*
 * @Desc:
 * @Version: v1.00
 * @Author: went
 * @Date: 2021-12-09 14:19:13
 * @LastEditors: went
 * @LastEditTime: 2022-07-29 10:13:40
 */
import jfRequest from "../../index";
import { ResponsePage, ResponseDetails } from "types/request";
// 工资模板列表
export function salaryTemplatePage() {
  return jfRequest.post<ResponsePage>({
    url: "/api/v1/web/wage/template/list",
    showLoading: true,
  });
}
// 新增工资模板
export function createSalaryTemplate(data: any) {
  return jfRequest.post<ResponseDetails>({
    url: "/api/v1/web/wage/template",
    showLoading: true,
    data,
  });
}
// 编辑工资模板
export function updateSalaryTemplate(data: any) {
  return jfRequest.put<ResponseDetails>({
    url: "/api/v1/web/wage/template",
    showLoading: true,
    data,
  });
}
// 获取工资模板详情信息
export function salaryTemplateDetails(id: string) {
  return jfRequest.get<ResponseDetails>({
    url: `/api/v1/web/wage/template/${id}`,
    showLoading: true,
  });
}
// 删除工资模板详情信息
export function deleteSalaryTemplate(id: string) {
  return jfRequest.delete<ResponseDetails>({
    url: `/api/v1/web/wage/template/${id}`,
    showLoading: true,
  });
}
// 删除工资模板 数据项
export function delSalaryItem(id: string) {
  return jfRequest.delete<ResponseDetails>({
    url: `/api/v1/web/wage/template/item/${id}`,
    showLoading: true,
  });
}
// 设置默认工资模版
export function setDefaultSalaryTemplate(id: string) {
  return jfRequest.put<ResponseDetails>({
    url: `/api/v1/web/wage/template/default/${id}`,
    showLoading: true,
  });
}
// 复制工资模版
export function copySalaryTemplate(id: string) {
  return jfRequest.post<ResponseDetails>({
    url: `/api/v1/web/wage/template/copy/${id}`,
    showLoading: true,
  });
}
